/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.util.List;
import model.metier.Employe;
import model.metier.Metier;
import org.hibernate.Query;
import org.hibernate.Session;

/**
 *
 * @author biron
 */
public class DaoEmploye extends DaoGeneric<Employe> {

    public DaoEmploye() {
        super();
    }

    public Employe connection(Employe employe) {

        String sql = "FROM employe WHERE emzil = ? AND mot_de_passe = ?";
        List<Object> l = getHibernateTemplate().find(sql, new Object[]{employe.getEmail(), employe.getMotDePasse()});
        if (l.size() != 0) {
            Employe empl = (Employe) l.get(0);
            return empl;
        }
        else{
            return null;
        }

    }

}
